{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from pandas import Series, DataFrame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import webbrowser"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "link = 'http://pandas.pydata.org/pandas-docs/version/0.20/io.html'\n",
    "webbrowser.open(link)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df1 = pd.read_clipboard()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>text</td>\n",
       "      <td>CSV</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>text</td>\n",
       "      <td>JSON</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>text</td>\n",
       "      <td>HTML</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>text</td>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>binary</td>\n",
       "      <td>MS Excel</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>binary</td>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>binary</td>\n",
       "      <td>Feather Format</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>binary</td>\n",
       "      <td>Msgpack</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>binary</td>\n",
       "      <td>Stata</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>binary</td>\n",
       "      <td>SAS</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>binary</td>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SQL</td>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Format Type      Data Description          Reader        Writer\n",
       "0         text                   CSV        read_csv        to_csv\n",
       "1         text                  JSON       read_json       to_json\n",
       "2         text                  HTML       read_html       to_html\n",
       "3         text       Local clipboard  read_clipboard  to_clipboard\n",
       "4       binary              MS Excel      read_excel      to_excel\n",
       "5       binary           HDF5 Format        read_hdf        to_hdf\n",
       "6       binary        Feather Format    read_feather    to_feather\n",
       "7       binary               Msgpack    read_msgpack    to_msgpack\n",
       "8       binary                 Stata      read_stata      to_stata\n",
       "9       binary                   SAS        read_sas              \n",
       "10      binary  Python Pickle Format     read_pickle     to_pickle\n",
       "11         SQL                   SQL        read_sql        to_sql\n",
       "12         SQL      Google Big Query        read_gbq        to_gbq"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df1.to_clipboard()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>text</td>\n",
       "      <td>CSV</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>text</td>\n",
       "      <td>JSON</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>text</td>\n",
       "      <td>HTML</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>text</td>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>binary</td>\n",
       "      <td>MS Excel</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>binary</td>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>binary</td>\n",
       "      <td>Feather Format</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>binary</td>\n",
       "      <td>Msgpack</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>binary</td>\n",
       "      <td>Stata</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>binary</td>\n",
       "      <td>SAS</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>binary</td>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SQL</td>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Format Type      Data Description          Reader        Writer\n",
       "0         text                   CSV        read_csv        to_csv\n",
       "1         text                  JSON       read_json       to_json\n",
       "2         text                  HTML       read_html       to_html\n",
       "3         text       Local clipboard  read_clipboard  to_clipboard\n",
       "4       binary              MS Excel      read_excel      to_excel\n",
       "5       binary           HDF5 Format        read_hdf        to_hdf\n",
       "6       binary        Feather Format    read_feather    to_feather\n",
       "7       binary               Msgpack    read_msgpack    to_msgpack\n",
       "8       binary                 Stata      read_stata      to_stata\n",
       "9       binary                   SAS        read_sas              \n",
       "10      binary  Python Pickle Format     read_pickle     to_pickle\n",
       "11         SQL                   SQL        read_sql        to_sql\n",
       "12         SQL      Google Big Query        read_gbq        to_gbq"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df1.to_csv('df1.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dataframe IO.ipynb df1.csv\r\n"
     ]
    }
   ],
   "source": [
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[?1h\u001b=\r",
      "Format Type,Data Description,Reader,Writer\r\n",
      "text,CSV,read_csv,to_csv\r\n",
      "text,JSON,read_json,to_json\r\n",
      "text,HTML,read_html,to_html\r\n",
      "text,Local clipboard,read_clipboard,to_clipboard\r\n",
      "binary,MS Excel,read_excel,to_excel\r\n",
      "binary,HDF5 Format,read_hdf,to_hdf\r\n",
      "binary,Feather Format,read_feather,to_feather\r\n",
      "binary,Msgpack,read_msgpack,to_msgpack\r\n",
      "binary,Stata,read_stata,to_stata\r\n",
      "binary,SAS,read_sas, \r\n",
      "binary,Python Pickle Format,read_pickle,to_pickle\r\n",
      "SQL,SQL,read_sql,to_sql\r\n",
      "SQL,Google Big Query,read_gbq,to_gbq\r\n",
      "\r",
      "\u001b[K\u001b[?1l\u001b>"
     ]
    }
   ],
   "source": [
    "!more df1.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df2 = pd.read_csv('df1.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>text</td>\n",
       "      <td>CSV</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>text</td>\n",
       "      <td>JSON</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>text</td>\n",
       "      <td>HTML</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>text</td>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>binary</td>\n",
       "      <td>MS Excel</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>binary</td>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>binary</td>\n",
       "      <td>Feather Format</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>binary</td>\n",
       "      <td>Msgpack</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>binary</td>\n",
       "      <td>Stata</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>binary</td>\n",
       "      <td>SAS</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>binary</td>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SQL</td>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Format Type      Data Description          Reader        Writer\n",
       "0         text                   CSV        read_csv        to_csv\n",
       "1         text                  JSON       read_json       to_json\n",
       "2         text                  HTML       read_html       to_html\n",
       "3         text       Local clipboard  read_clipboard  to_clipboard\n",
       "4       binary              MS Excel      read_excel      to_excel\n",
       "5       binary           HDF5 Format        read_hdf        to_hdf\n",
       "6       binary        Feather Format    read_feather    to_feather\n",
       "7       binary               Msgpack    read_msgpack    to_msgpack\n",
       "8       binary                 Stata      read_stata      to_stata\n",
       "9       binary                   SAS        read_sas              \n",
       "10      binary  Python Pickle Format     read_pickle     to_pickle\n",
       "11         SQL                   SQL        read_sql        to_sql\n",
       "12         SQL      Google Big Query        read_gbq        to_gbq"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>text</td>\n",
       "      <td>CSV</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>text</td>\n",
       "      <td>JSON</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>text</td>\n",
       "      <td>HTML</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>text</td>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>binary</td>\n",
       "      <td>MS Excel</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>binary</td>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>binary</td>\n",
       "      <td>Feather Format</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>binary</td>\n",
       "      <td>Msgpack</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>binary</td>\n",
       "      <td>Stata</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>binary</td>\n",
       "      <td>SAS</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>binary</td>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SQL</td>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Format Type      Data Description          Reader        Writer\n",
       "0         text                   CSV        read_csv        to_csv\n",
       "1         text                  JSON       read_json       to_json\n",
       "2         text                  HTML       read_html       to_html\n",
       "3         text       Local clipboard  read_clipboard  to_clipboard\n",
       "4       binary              MS Excel      read_excel      to_excel\n",
       "5       binary           HDF5 Format        read_hdf        to_hdf\n",
       "6       binary        Feather Format    read_feather    to_feather\n",
       "7       binary               Msgpack    read_msgpack    to_msgpack\n",
       "8       binary                 Stata      read_stata      to_stata\n",
       "9       binary                   SAS        read_sas              \n",
       "10      binary  Python Pickle Format     read_pickle     to_pickle\n",
       "11         SQL                   SQL        read_sql        to_sql\n",
       "12         SQL      Google Big Query        read_gbq        to_gbq"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"Format Type\":{\"0\":\"text\",\"1\":\"text\",\"2\":\"text\",\"3\":\"text\",\"4\":\"binary\",\"5\":\"binary\",\"6\":\"binary\",\"7\":\"binary\",\"8\":\"binary\",\"9\":\"binary\",\"10\":\"binary\",\"11\":\"SQL\",\"12\":\"SQL\"},\"Data Description\":{\"0\":\"CSV\",\"1\":\"JSON\",\"2\":\"HTML\",\"3\":\"Local clipboard\",\"4\":\"MS Excel\",\"5\":\"HDF5 Format\",\"6\":\"Feather Format\",\"7\":\"Msgpack\",\"8\":\"Stata\",\"9\":\"SAS\",\"10\":\"Python Pickle Format\",\"11\":\"SQL\",\"12\":\"Google Big Query\"},\"Reader\":{\"0\":\"read_csv\",\"1\":\"read_json\",\"2\":\"read_html\",\"3\":\"read_clipboard\",\"4\":\"read_excel\",\"5\":\"read_hdf\",\"6\":\"read_feather\",\"7\":\"read_msgpack\",\"8\":\"read_stata\",\"9\":\"read_sas\",\"10\":\"read_pickle\",\"11\":\"read_sql\",\"12\":\"read_gbq\"},\"Writer\":{\"0\":\"to_csv\",\"1\":\"to_json\",\"2\":\"to_html\",\"3\":\"to_clipboard\",\"4\":\"to_excel\",\"5\":\"to_hdf\",\"6\":\"to_feather\",\"7\":\"to_msgpack\",\"8\":\"to_stata\",\"9\":\" \",\"10\":\"to_pickle\",\"11\":\"to_sql\",\"12\":\"to_gbq\"}}'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.to_json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>CSV</td>\n",
       "      <td>text</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>JSON</td>\n",
       "      <td>text</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>HTML</td>\n",
       "      <td>text</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>text</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MS Excel</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Feather Format</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Msgpack</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Stata</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>SAS</td>\n",
       "      <td>binary</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Data Description Format Type          Reader        Writer\n",
       "0                    CSV        text        read_csv        to_csv\n",
       "1                   JSON        text       read_json       to_json\n",
       "10  Python Pickle Format      binary     read_pickle     to_pickle\n",
       "11                   SQL         SQL        read_sql        to_sql\n",
       "12      Google Big Query         SQL        read_gbq        to_gbq\n",
       "2                   HTML        text       read_html       to_html\n",
       "3        Local clipboard        text  read_clipboard  to_clipboard\n",
       "4               MS Excel      binary      read_excel      to_excel\n",
       "5            HDF5 Format      binary        read_hdf        to_hdf\n",
       "6         Feather Format      binary    read_feather    to_feather\n",
       "7                Msgpack      binary    read_msgpack    to_msgpack\n",
       "8                  Stata      binary      read_stata      to_stata\n",
       "9                    SAS      binary        read_sas              "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_json(df1.to_json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1.to_html('df1.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dataframe IO.ipynb df1.csv            df1.html\r\n"
     ]
    }
   ],
   "source": [
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1.to_excel('df1.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dataframe IO.ipynb df1.csv            df1.html           df1.xlsx\r\n"
     ]
    }
   ],
   "source": [
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Format Type</th>\n",
       "      <th>Data Description</th>\n",
       "      <th>Reader</th>\n",
       "      <th>Writer</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>text</td>\n",
       "      <td>CSV</td>\n",
       "      <td>read_csv</td>\n",
       "      <td>to_csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>text</td>\n",
       "      <td>JSON</td>\n",
       "      <td>read_json</td>\n",
       "      <td>to_json</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>text</td>\n",
       "      <td>HTML</td>\n",
       "      <td>read_html</td>\n",
       "      <td>to_html</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>text</td>\n",
       "      <td>Local clipboard</td>\n",
       "      <td>read_clipboard</td>\n",
       "      <td>to_clipboard</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>binary</td>\n",
       "      <td>MS Excel</td>\n",
       "      <td>read_excel</td>\n",
       "      <td>to_excel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>binary</td>\n",
       "      <td>HDF5 Format</td>\n",
       "      <td>read_hdf</td>\n",
       "      <td>to_hdf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>binary</td>\n",
       "      <td>Feather Format</td>\n",
       "      <td>read_feather</td>\n",
       "      <td>to_feather</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>binary</td>\n",
       "      <td>Msgpack</td>\n",
       "      <td>read_msgpack</td>\n",
       "      <td>to_msgpack</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>binary</td>\n",
       "      <td>Stata</td>\n",
       "      <td>read_stata</td>\n",
       "      <td>to_stata</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>binary</td>\n",
       "      <td>SAS</td>\n",
       "      <td>read_sas</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>binary</td>\n",
       "      <td>Python Pickle Format</td>\n",
       "      <td>read_pickle</td>\n",
       "      <td>to_pickle</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SQL</td>\n",
       "      <td>SQL</td>\n",
       "      <td>read_sql</td>\n",
       "      <td>to_sql</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SQL</td>\n",
       "      <td>Google Big Query</td>\n",
       "      <td>read_gbq</td>\n",
       "      <td>to_gbq</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Format Type      Data Description          Reader        Writer\n",
       "0         text                   CSV        read_csv        to_csv\n",
       "1         text                  JSON       read_json       to_json\n",
       "2         text                  HTML       read_html       to_html\n",
       "3         text       Local clipboard  read_clipboard  to_clipboard\n",
       "4       binary              MS Excel      read_excel      to_excel\n",
       "5       binary           HDF5 Format        read_hdf        to_hdf\n",
       "6       binary        Feather Format    read_feather    to_feather\n",
       "7       binary               Msgpack    read_msgpack    to_msgpack\n",
       "8       binary                 Stata      read_stata      to_stata\n",
       "9       binary                   SAS        read_sas              \n",
       "10      binary  Python Pickle Format     read_pickle     to_pickle\n",
       "11         SQL                   SQL        read_sql        to_sql\n",
       "12         SQL      Google Big Query        read_gbq        to_gbq"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
